<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>

<body>
<script>


var s ="javascript is not java";
var r = /java(script)?/g;
var a = s.match(r); 			// 返回数组["javascript","java"]


</script>
</body>
</html>
